﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using DevComponents.DotNetBar;

namespace Quanlybanhang
{
    public partial class TimkiemChubanForm : Office2007Form
    {
        public TimkiemChubanForm()
        {
            InitializeComponent();
        }

        private void txtThongtin_TextChanged(object sender, EventArgs e)
        {
            string cmb_cmd = "select ten as 'Tên', diachi as 'Địa chỉ', dienthoai as 'Điện thoại', sono as 'Số nợ' from chuhang where kieu=2 and (ten like '%" + txtThongtin.Text + "%' or diachi like '%" + txtThongtin.Text + "%')";
            SqlDataAdapter sda = new SqlDataAdapter(cmb_cmd, MainForm.con);
            DataTable dt = new DataTable();
            sda = new SqlDataAdapter(cmb_cmd, MainForm.con);
            DataTable dt1 = new DataTable();
            sda.Fill(dt1);
            dataGridViewX1.DataSource = dt1;
        }
    }
}
